/**
 * Created on May 12, 2007
 */
package jvs.vfs.tools;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Frame;

import javax.swing.JFrame;
import javax.swing.JPanel;

import x.java.io.File;

/**
 * @author qiangli
 * 
 */
public class EditorDialog extends BasicDialog {

	private static final long serialVersionUID = 1L;
	private File file;

	public EditorDialog(Frame owner, File file) {
		super(new JFrame(), false);
		this.file = file;
		buildUI();
	}


	private void buildUI() {
		JPanel custom = new JPanel();
		custom.setPreferredSize(new Dimension(600,500));
		custom.setLayout(new BorderLayout());
		Notepad pad = new Notepad(file.getPath());
		custom.add(pad,BorderLayout.CENTER);
		getContentPane().setLayout(new BorderLayout());
		getContentPane().add(custom, BorderLayout.CENTER);
		
		pack();
		setLocationRelativeTo(getOwner());
	}
}
